import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
//注册全局组件
import TypeNav from '@/components/TypeNav'
import Carousel from '@/components/Carousel'
import Pagination from '@/components/Pagination'
import store from '@/store'
import '@/mock/mockserve'
import 'swiper/css/swiper.css'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
//引入图片懒加载插件
import '@/plugins/lazyload'
//引入validate插件(vee-validate)
import '@/plugins/validate'
Vue.component(TypeNav.name,TypeNav)
Vue.component(Carousel.name,Carousel)
Vue.component(Pagination.name,Pagination)
Vue.use(ElementUI)
//elementui注册组件时候，还有一种写法，挂在原型上

//测试
// import {reqCategoryList} from '@/api'
// reqCategoryList();
// import {getSearchInfo} from '@/api'
// console.log(getSearchInfo());

//统一接口api文件夹里的全部请求函数
import * as API from '@/api'
//console.log(API);
new Vue({
  render: h => h(App),
  beforeCreate(){
    Vue.prototype.$bus=this
    Vue.prototype.$API=API
  },
  router,
  store
}).$mount('#app')
